const generator = require('@babel/generator').default; // 将 AST 还原成 JavaScript 代码
const parse = require("@babel/parser");                // 编译成语法树
const traverse = require("@babel/traverse").default;   // 对语法树进行操作
const types = require("@babel/types");                  // 判断、验证节点的类型、构建新 AST 节点等
const fs = require("fs");                               // 读取文件

const File1 = process.argv.length > 2 ? process.argv[2] : './encode.js';
const File2 = process.argv.length > 3 ? process.argv[3] : './decode.js';

const jscode = fs.readFileSync(File1, { encoding: 'utf-8' });
const ast = parse.parse(jscode, { sourceType: "module" });

//快速定位56位数组
const getGenCode = {
  AssignmentExpression(path) {
    const { node } = path;
    const { left, right, operator } = node;

    if (!types.isIdentifier(left) || !types.isArrayExpression(right) || operator !== "=") {
      return;
    }

    if (right.elements.length !== 56) return;
    console.log("nocaptcha : \n", path.toString());
  }
};
traverse(ast, getGenCode);

//获取解混淆的数组
let key_arry = []
const get_key = {
  MemberExpression(path){
    let {object,property} = path.node;
    if(!types.isCallExpression(object) || !types.isCallExpression(property)){
      return;
    }
    if(!types.isIdentifier(object.callee) || object.arguments.length != 0){
      return;
    }
    if(!types.isIdentifier(property.callee)){
      return;
    }

    if(key_arry.includes(path.toString())){
      return;
    }

    // console.log(path.toString())

    key_arry.push(path.toString())
  }
}
traverse(ast,get_key)
console.log(key_arry)
// 将数组保存到本地文件
// 将数组转换为字符串
const data = JSON.stringify(key_arry, null, 2); // 格式化输出
// 写入文件
fs.writeFile('output.json', data, (err) => {
  if (err) {
    console.error('写入文件时出错:', err);
  } else {
    console.log('内容已成功保存到 output.json!');
  }
});

//拿到所有的key我们去网页上执行把对应的结果掏下来，断到加密结束的位置，然后在代码段执行下面代码
// key_arry = []
// let result_map = {};
// for(let jidong = 0;jidong < key_arry.length;jidong++){
//     try{
//         let result = eval(key_arry[jidong] + '()');
//         if(typeof result == 'function')continue;
//         result_map[key_arry[jidong]] = result;
//     }catch{
//     }
// }
// console.log(result_map)
// copy(result_map)

//复制映射拿到本地开始替换

const result_map = {
    "m4()[mC(U0)]": "Math",
    "m4()[mC(Ts)]": "-1",
    "b0()[Z(UB)]": "Notification",
    "m4()[mC(DB)]": "undefined",
    "m4()[mC(L0)]": "1",
    "jV()[wz(n6)]": "0",
    "b0()[Z(wn)]": "e",
    "m4()[mC(rs)]": "window",
    "jV()[wz(rs)]": "Object",
    "tC()[dz(dp)]": "prototype",
    "O0()[n8(jz)]": "chrome",
    "m4()[mC(dp)]": "valueOf",
    "O0()[n8(j8)]": "navigator",
    "g7()[bC(kj)]": "plugins",
    "O0()[n8(Jm)]": "location",
    "g7()[bC(UN)]": "-112",
    "g7()[bC(Fz)]": "",
    "tC()[dz(zn)]": "Boolean",
    "tC()[dz(UN)]": "floor",
    "tC()[dz(HW)]": "random",
    "jV()[wz(UN)]": "toString",
    "xx()[Kr(mt)]": "t_en",
    "tC()[dz(L0)]": "n",
    "xx()[Kr(Ts)]": "Function",
    "tC()[dz(Qm)]": "__selenium_unwrapped",
    "xx()[Kr(n6)]": "create",
    "tC()[dz(jz)]": "stack",
    "m4()[mC(tP)]": "string",
    "b0()[Z(DB)]": "split",
    "m4()[mC(cz)]": "\n",
    "xx()[Kr(Qm)]": "forEach",
    "bh()[Pt(gj)]": "includes",
    "tC()[dz(lB)]": "stripProxyFromErrors",
    "xx()[Kr(q7)]": "at newHandler.<computed> [as apply]",
    "O0()[n8(dp)]": "constructor",
    "tC()[dz(DB)]": "name",
    "m4()[mC(w0)]": "watinExpressionResult",
    "b0()[Z(bn)]": "Document",
    "b0()[Z(Y9)]": "r",
    "b0()[Z(d4)]": "hasOwnProperty",
    "m4()[mC(w4)]": "m",
    "m4()[mC(r9)]": "hasPrivateToken",
    "O0()[n8(w4)]": "get",
    "O0()[n8(UB)]": "sensorData",
    "m4()[mC(zn)]": "indexOf",
    "sO()[dv(rs)]": "PushManager",
    "m4()[mC(wI)]": ",",
    "jV()[wz(T)]": "width",
    "m4()[mC(c4)]": "length",
    "O0()[n8(kL)]": "fLK",
    "b0()[Z(w4)]": "Array",
    "bh()[Pt(c4)]": "c",
    "tC()[dz(NX)]": "XPathResult",
    "tC()[dz(kj)]": "document",
    "bh()[Pt(gG)]": "documentElement",
    "UY()[EP(n6)]": "",
    "sO()[dv(vh)]": "driver",
    "tC()[dz(CE)]": "applyFunc",
    "b0()[Z(UX)]": "selenium",
    "jV()[wz(gj)]": "join",
    "m4()[mC(HW)]": "t",
    "jV()[wz(DB)]": "__esModule",
    "jV()[wz(U0)]": "d",
    "O0()[n8(rs)]": "defineProperty",
    "jV()[wz(w4)]": "enumerable",
    "m4()[mC(UN)]": "value",
    "bh()[Pt(AP)]": "btoa",
    "O0()[n8(kj)]": "",
    "O0()[n8(L0)]": "String",
    "xx()[Kr(c4)]": "charAt",
    "m4()[mC(hO)]": "charCodeAt",
    "jV()[wz(Y9)]": "5",
    "s3()[st(c4)]": "o",
    "bh()[Pt(d4)]": "decodeURIComponent",
    "tC()[dz(QB)]": "~",
    "m4()[mC(d4)]": "parseInt",
    "jV()[wz(d4)]": "lwAAAHq3neYAAOgA5gABIugA5gAA6ADmAAFc6AArAAZ3aW5kb3fmAAluYXZpZ2F0b3K1AeYACXVzZXJBZ2VudLUB5gAFc3BsaXS1ANQBAAHmAARqb2lutQDUAQAB5gAFc3BsaXS1ANQBAAHmAARqb2lutQDUAQABOwOQAAAAAAAF5gACbXYaAJcAAACyt53mAAJ2QxoA6ALoACsAAnZD5gAIdG9TdHJpbme1ANQBAAE7A5AAAQAAAI3mAAJNbRoAlwAAAU63neYAAkcwGgAp5gACblYaAIgAABUFKwACblYaAOgA5gACVlgaACsAAkcw5gAGbGVuZ3RotQErAAJWWM8HAAAAAUS3KwACVljoACsAAkcw5gAKY2hhckNvZGVBdLUA1AEAAeghKwACblZ3QisAAm5WGgA7KwACVli2ApcAAADr6AArAAJuVgI7A5AAAQAAAMXmAAJscxoAlwAACaK3neYAAmJqGgDmAAJIbRoA5gACU3AaAOYAAk9zGgAp5gACbWoaAOYAAW4rAAJtahoAlwAACYq3KeYAAk00GgAp5gACeG0aACnmAAJUTBoA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AkVDGgA7KwACSGq2ApcAAAaT5gAAKwACRzgaACsAAmJqKwAGd2luZG935gAEYm1ha7UB5gAHc3RhcnRUc7UBY+gAKwAGU3RyaW5n1AEAASsAAlNw6AArAAZTdHJpbmfUAQABYysAAkltGgDoAOYAAm04GgArAAJJbeYABmxlbmd0aLUBKwACbTjPBwAAAAk+tynmAAJQNBoAKwACdjbmAAZsZW5ndGi1ASsAAm046AArAAJJbeYABmNoYXJBdLUA1AEAAegA6AroACsACHBhcnNlSW501AEAAjMrAAJQNBoAKwACdjYrAAJQNLUBKwACRzhjKwACRzgaADsrAAJtOLYClwAACKsrAAJFQysAAkc4YysAAm1qGgA7lwAACXIrAAZ3aW5kb3fmAAluYXZpZ2F0b3JkhAAAAAOfOwO35gACY3MaAOYAAWUrAAJtahoAOwMDiAAACYmIAAAJdIgAAAGXUwArAAJtajsDkAAEAAABYeYAAkk4GgCg",
    "b0()[Z(L0)]": "a",
    "O0()[n8(d4)]": "exports",
    "O0()[n8(U0)]": "i",
    "b0()[Z(n6)]": "l",
    "xx()[Kr(dp)]": "p",
    "tC()[dz(d4)]": "s",
    "b0()[Z(rs)]": "message",
    "O0()[n8(UN)]": "function",
    "tC()[dz(U0)]": "assign",
    "m4()[mC(j8)]": "writable",
    "tC()[dz(w4)]": "configurable",
    "jV()[wz(CE)]": "$cdc_asdjflasutopfhvcZLmcfl_",
    "jV()[wz(YE)]": "webdriver",
    "jV()[wz(rO)]": "number",
    "O0()[n8(x0)]": "deviceorientation",
    "O0()[n8(X3)]": "__webdriver_script_func",
    "s3()[st(X3)]": "productSub",
    "tC()[dz(Jh)]": "language",
    "m4()[mC(G4)]": "fLh",
    "m4()[mC(Q3)]": "product",
    "m4()[mC(Y9)]": "7",
    "b0()[Z(kj)]": "Symbol",
    "bh()[Pt(vL)]": "Module",
    "m4()[mC(gG)]": "abcdefghijklmnopaqrstuvxyzABCDEFGHIJKLMNOPAQRSTUVXYZ!@#%&-_=;:<>,~",
    "m4()[mC(T)]": "fromCharCode",
    "xx()[Kr(kj)]": "fLhWWsWlKKKKKK",
    "jV()[wz(HW)]": "codePointAt",
    "m4()[mC(Qm)]": "deltaTimestamp",
    "tC()[dz(gj)]": "sqrt",
    "m4()[mC(F4)]": "|",
    "O0()[n8(gj)]": "replace",
    "jV()[wz(tP)]": "RegExp",
    "jV()[wz(j8)]": "g",
    "b0()[Z(HW)]": "fpValStr",
    "O0()[n8(tP)]": "td",
    "jV()[wz(YV)]": "rVal",
    "jV()[wz(kj)]": "8",
    "s3()[st(Y9)]": "",
    "bh()[Pt(kj)]": ";",
    "jV()[wz(Qm)]": "height",
    "O0()[n8(T)]": "__$webdriverAsyncExecutor",
    "jV()[wz(Uz)]": "cdc_adoQpoasnfa76pfcZLmcfl_Array",
    "bh()[Pt(L0)]": "afSbep8yjnZUjq3aL010jO15Sawj2VZfdYK8uY90uxq",
    "bh()[Pt(U0)]": "",
    "O0()[n8(Jr)]": "fLj",
    "m4()[mC(Jm)]": "calledSelenium",
    "jV()[wz(N)]": "fLx",
    "O0()[n8(Zm)]": "slice",
    "b0()[Z(OP)]": "Set",
    "b0()[Z(Qm)]": "RTCPeerConnection",
    "jV()[wz(NE)]": "fmget_targets",
    "O0()[n8(NE)]": "test",
    "tC()[dz(Uz)]": "setInterval",
    "m4()[mC(Qt)]": "OSMJIF",
    "tC()[dz(gG)]": "localStorage",
    "xx()[Kr(wI)]": "__driver_unwrapped",
    "jV()[wz(Ts)]": "removeItem",
    "O0()[n8(Qm)]": "__lastWatirAlert",
    "b0()[Z(UN)]": "fLjNgNhhs",
    "tC()[dz(d9)]": "collectSeleniumData",
    "tC()[dz(X3)]": "publish",
    "O0()[n8(YL)]": "protocol",
    "m4()[mC(UP)]": "//",
    "m4()[mC(E6)]": "hostname",
    "xx()[Kr(T)]": "ak_",
    "O0()[n8(w0)]": "size",
    "xx()[Kr(Yz)]": "hardwareConcurrency",
    "m4()[mC(lN)]": "src",
    "sO()[dv(sY)]": "https://",
    "tC()[dz(dW)]": "synthesisSpeechHash",
    "sO()[dv(HW)]": "",
    "tC()[dz(Y9)]": "9",
    "O0()[n8(lB)]": ",,,",
    "O0()[n8(Uz)]": "$chrome_asyncScriptInfo",
    "jV()[wz(dp)]": "push",
    "tC()[dz(YM)]": "_sdTrace",
    "xx()[Kr(lN)]": "deviceData",
    "jV()[wz(I0)]": "stackLen",
    "tC()[dz(Iz)]": "device-info",
    "O0()[n8(VB)]": "visibilitychange",
    "m4()[mC(IN)]": "DeviceMotionEvent",
    "m4()[mC(b6)]": "addEventListener",
    "jV()[wz(T4)]": "blur",
    "jV()[wz(IN)]": "focus",
    "m4()[mC(q7)]": "fLggggggg",
    "xx()[Kr(Q0)]": "touchmove",
    "b0()[Z(X3)]": "__fxdriver_evaluate",
    "b0()[Z(Zp)]": "touchend",
    "b0()[Z(cz)]": "mousemove",
    "jV()[wz(zr)]": "click",
    "b0()[Z(r9)]": "mousedown",
    "b0()[Z(Gp)]": "pointerdown",
    "jV()[wz(NX)]": "pointerup",
    "m4()[mC(OB)]": "keydown",
    "tC()[dz(A6)]": "map",
    "tC()[dz(z4)]": "InstallTrigger",
    "m4()[mC(Ls)]": "firstLoad",
    "jV()[wz(c4)]": "fL",
    "jV()[wz(P7)]": "getElementsByTagName",
    "m4()[mC(Cp)]": "input",
    "xx()[Kr(P7)]": "opera",
    "b0()[Z(IN)]": "toLowerCase",
    "m4()[mC(YL)]": "domAutomationController",
    "jV()[wz(As)]": "ax",
    "tC()[dz(b6)]": "documentMode",
    "b0()[Z(c4)]": "parseFloat",
    "O0()[n8(P7)]": "notifications",
    "jV()[wz(x6)]": "aprApInFlight",
    "xx()[Kr(jz)]": "ajTypeBitmask",
    "xx()[Kr(lB)]": "failedAprApBackoff",
    "jV()[wz(Rr)]": "<bpd>",
    "m4()[mC(kj)]": "3",
    "O0()[n8(x6)]": "do_en",
    "tC()[dz(E6)]": "dm_en",
    "O0()[n8(jB)]": "TouchEvent",
    "xx()[Kr(dW)]": "iReset",
    "xx()[Kr(rp)]": "URL",
    "jV()[wz(fM)]": "\\\\|\"",
    "O0()[n8(MM)]": "startTimestamp",
    "b0()[Z(CB)]": "mouseMoveData",
    "jV()[wz(mm)]": "totVel",
    "jV()[wz(VB)]": ",,,,,,",
    "b0()[Z(Rr)]": "-100",
    "m4()[mC(zr)]": "-105",
    "b0()[Z(Iz)]": "-108",
    "jV()[wz(EL)]": "-101",
    "b0()[Z(fM)]": "-110",
    "jV()[wz(x0)]": "-109",
    "O0()[n8(Q0)]": "-102",
    "O0()[n8(CB)]": "-111",
    "jV()[wz(A6)]": "-114",
    "tC()[dz(mt)]": "-103",
    "jV()[wz(KV)]": "-106",
    "b0()[Z(mm)]": "-115",
    "xx()[Kr(YM)]": "-123",
    "O0()[n8(Rr)]": "-124",
    "xx()[Kr(bn)]": "-127",
    "m4()[mC(NX)]": "-132",
    "xx()[Kr(UB)]": "-133",
    "jV()[wz(Zp)]": "-70",
    "b0()[Z(VB)]": "-80",
    "jV()[wz(cz)]": "-90",
    "xx()[Kr(Qp)]": "-116",
    "O0()[n8(r9)]": "getVoices",
    "O0()[n8(Iz)]": "-129",
    "b0()[Z(EL)]": "-134",
    "m4()[mC(n6)]": "6",
    "tC()[dz(Ls)]": "requestWakeLock",
    "O0()[n8(fM)]": "fLxh",
    "m4()[mC(tX)]": "__lastWatirPrompt",
    "jV()[wz(Qt)]": "isArray",
    "xx()[Kr(Rr)]": "speechSynthesis",
    "jV()[wz(B)]": "onvoiceschanged",
    "xx()[Kr(fM)]": "geolocation",
    "xx()[Kr(mm)]": "midi",
    "jV()[wz(Cp)]": "camera",
    "b0()[Z(Jh)]": "microphone",
    "O0()[n8(B)]": "speaker",
    "m4()[mC(CW)]": "background-sync",
    "b0()[Z(b6)]": "bluetooth",
    "jV()[wz(cA)]": "persistent-storage",
    "O0()[n8(Jh)]": "ambient-light-sensor",
    "tC()[dz(fM)]": "accelerometer",
    "O0()[n8(b6)]": "gyroscope",
    "tC()[dz(mm)]": "magnetometer",
    "xx()[Kr(VB)]": "accessibility-events",
    "O0()[n8(z4)]": "clipboard-write",
    "b0()[Z(z4)]": "payment-handler",
    "tC()[dz(VB)]": "permissions",
    "xx()[Kr(EL)]": "query",
    "tC()[dz(EL)]": "then",
    "jV()[wz(tS)]": "catch",
    "tC()[dz(KV)]": "all",
    "tC()[dz(G4)]": "mozIsLocallyAvailable",
    "O0()[n8(n6)]": "2",
    "b0()[Z(tS)]": "Number",
    "xx()[Kr(cz)]": "ontouchstart",
    "O0()[n8(cA)]": "maxTouchPoints",
    "O0()[n8(tS)]": "msMaxTouchPoints",
    "jV()[wz(JW)]": "availWidth",
    "xx()[Kr(r9)]": "availHeight",
    "jV()[wz(CB)]": "getHeartbeatTimestamp",
    "tC()[dz(P7)]": "innerHeight",
    "xx()[Kr(NX)]": "non:",
    "xx()[Kr(Gp)]": "innerWidth",
    "tC()[dz(B)]": "outerWidth",
    "O0()[n8(UX)]": "_phantom",
    "jV()[wz(jB)]": "failedAprApCnt",
    "b0()[Z(CW)]": "domAutomation",
    "xx()[Kr(T4)]": ",loc:",
    "b0()[Z(Qp)]": "lastAprAutopostTS",
    "O0()[n8(YM)]": "aprApTimer",
    "xx()[Kr(zn)]": "bm_sz",
    "O0()[n8(wn)]": "CustomErrorAfterFunctionCall",
    "O0()[n8(pK)]": "subscribe",
    "O0()[n8(bn)]": "navPerm",
    "b0()[Z(I0)]": "buildPostData",
    "b0()[Z(x6)]": "calcSynthesisSpeechHash",
    "xx()[Kr(d9)]": "navigatorPermissions",
    "jV()[wz(MM)]": "rir",
    "O0()[n8(Qp)]": "getCookie",
    "b0()[Z(jB)]": "getDeviceData",
    "m4()[mC(T4)]": "getBrowser",
    "tC()[dz(UP)]": "collectHeadlessSignals",
    "jV()[wz(Q0)]": "processAutopostRes",
    "xx()[Kr(UP)]": "postData",
    "O0()[n8(I0)]": "checkIprSignals",
    "b0()[Z(MM)]": "extractAbckHeartbeatTimestamp",
    "O0()[n8(Y9)]": ".",
    "b0()[Z(Q3)]": "get_telemetry",
    "tC()[dz(CW)]": "form_submit",
    "m4()[mC(rO)]": "webkitTemporaryStorage",
    "tC()[dz(lX)]": "listFunctions",
    "O0()[n8(Cp)]": "hypot",
    "m4()[mC(jk)]": "^http:\\/\\/",
    "O0()[n8(F4)]": "__lastWatirConfirm",
    "tC()[dz(M3)]": "/_bm/_data",
    "O0()[n8(Q3)]": "lastIndexOf",
    "O0()[n8(BE)]": "/",
    "b0()[Z(NK)]": "_setIpr",
    "m4()[mC(rR)]": "cTc",
    "m4()[mC(XI)]": "<init/>",
    "tC()[dz(JW)]": "currentScript",
    "m4()[mC(JW)]": "imul",
    "m4()[mC(gs)]": "FileReader",
    "b0()[Z(QB)]": "cdc_adoQpoasnfa76pfcZLmcfl_Promise",
    "xx()[Kr(hO)]": "__nightmare",
    "xx()[Kr(D4)]": "cdc_adoQpoasnfa76pfcZLmcfl_Symbol",
    "m4()[mC(IP)]": "_Selenium_IDE_Recorder",
    "jV()[wz(Un)]": "__driver_evaluate",
    "tC()[dz(T)]": "__fxdriver_unwrapped",
    "jV()[wz(wn)]": "__phantomas",
    "O0()[n8(QB)]": "__selenium_evaluate",
    "b0()[Z(RI)]": "__webdriverFuncgeb",
    "jV()[wz(Jr)]": "__webdriver__chr",
    "jV()[wz(OP)]": "__webdriver_script_fn",
    "jV()[wz(Yz)]": "__webdriver_script_function",
    "jV()[wz(pK)]": "__webdriver_unwrapped",
    "jV()[wz(Zm)]": "awesomium",
    "tC()[dz(F4)]": "spynner_additional_js_loaded",
    "b0()[Z(Uz)]": "calledPhantom",
    "O0()[n8(RI)]": "fLNp",
    "xx()[Kr(gG)]": "watinExpressionError",
    "b0()[Z(Un)]": "geb",
    "tC()[dz(Gp)]": "appMinorVersion",
    "tC()[dz(T4)]": "storage",
    "xx()[Kr(KV)]": "getGamepads",
    "jV()[wz(Ht)]": "getStorageUpdates",
    "xx()[Kr(Zp)]": "mediaDevices",
    "O0()[n8(OB)]": "fLQ",
    "tC()[dz(IN)]": "mozConnection",
    "m4()[mC(JL)]": "mozPhoneNumberService",
    "O0()[n8(Ht)]": "vib:",
    "m4()[mC(LI)]": "msManipulationViewsEnabled",
    "b0()[Z(Cp)]": "registerProtocolHandler",
    "jV()[wz(lX)]": "requestMediaKeySystemAccess",
    "jV()[wz(M3)]": "sendBeacon",
    "b0()[Z(cA)]": "serviceWorker",
    "tC()[dz(zr)]": "storeWebWideTrackingException",
    "O0()[n8(pG)]": "webkitGetGamepads",
    "b0()[Z(Ht)]": "XMLHttpRequest",
    "jV()[wz(JL)]": "XDomainRequest",
    "O0()[n8(jh)]": "emit",
    "xx()[Kr(G4)]": "spawn",
    "m4()[mC(BE)]": "Buffer",
    "jV()[wz(LI)]": "PointerEvent",
    "xx()[Kr(Ls)]": ",cpen:",
    "xx()[Kr(zr)]": "callPhantom",
    "m4()[mC(NK)]": "i1:",
    "O0()[n8(CW)]": "ActiveXObject",
    "jV()[wz(BE)]": "mozInnerScreenY",
    "jV()[wz(Q3)]": "onLine",
    "b0()[Z(lX)]": "opc:",
    "b0()[Z(M3)]": "fc:",
    "tC()[dz(OB)]": "sc:",
    "tC()[dz(pG)]": "wrc:",
    "b0()[Z(CE)]": "vibrate",
    "tC()[dz(Cp)]": "bat:",
    "b0()[Z(JW)]": "getBattery",
    "b0()[Z(JL)]": "x11:",
    "O0()[n8(lX)]": "x12:",
    "b0()[Z(rO)]": "aeiouy13579",
    "jV()[wz(L0)]": "4",
    "b0()[Z(dp)]": "set",
    "tC()[dz(n6)]": "sjs_r"
}

const tihuan = {
  CallExpression(path){
    let callee = path.node.callee;
    if(!types.isMemberExpression(callee)){
      return;
    }
    let {object,property} = callee;

    if(types.isMemberExpression(object) && types.isIdentifier(property)
      && ['call','apply'].includes(property.name)){
        if(!Object.keys(result_map).includes(generator(object).code)){
          return;
        }
        path.replaceWith(types.valueToNode(result_map[generator(object).code]))
        console.log(generator(object).code,'--------->',result_map[generator(object).code])
    }

    if(types.isCallExpression(object) && types.isCallExpression(property)){
      if(types.isIdentifier(object.callee) && object.arguments.length == 0){
        if(types.isIdentifier(property.callee)){

          if(!Object.keys(result_map).includes(generator(callee).code)){
            return;
          }
          path.replaceWith(types.valueToNode(result_map[generator(callee).code]))
          console.log(generator(callee).code,'--------->',result_map[generator(callee).code])
        }
      }
    }

  }
}
traverse(ast,tihuan)


const { code } = generator(ast);
// console.log(code);
fs.writeFile(File2, code, (err) => {
  if (err) throw err;
  console.log(`File has been saved as ${File2}`);
});
